using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Customer_MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["username"] != null)
        {
            lnkProfile.Visible = true;
            lnkLoginout.Text = "Log-out";
            lnkProfile.Text = Session["username"].ToString();
            Label1.Text = "Hello " + Session["role"];
        }
        else
        {
            lnkProfile.Visible = false;
            lnkLoginout.Text = "Log-in";
        }
    }
    protected void lnkLoginout_Click(object sender, EventArgs e)
    {
        if (lnkLoginout.Text == "Log-in")
        {
            Response.Redirect("login.aspx");
        }
        else
        {
            Session["username"] = null;
            Session["role"] = null;
            Response.Redirect("index.aspx");
        }
    }
}
